﻿@model IEnumerable<RedSand.Site.Models.RoleInfo>
<div class="panel">
    <div class="panel-header">
        <span>Role manager</span>
    </div>
    <div class="panel-content">
        <div class="panel-toolbar">
            <ul>
                <li>
                    @Ajax.ActionLink("Add", "create", null, AdminAjaxOptions.GetForm, new { @class = "btn-create" })
                </li>
            </ul>
        </div>
        @if (Model == null)
        {
            <div class="message warning">Data Empty</div>
        }
        else
        {
            <table class="table-list">
                <thead>
                    <tr>
                        <th>
                            Role
                        </th>
                        <th class="center width-80">
                            Status
                        </th>
                        <th class="center width-80">
                            Control
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                @item.Name
                            </td>
                            <td class="center">
                                @DropDownListHelper.GetStatusString(item.Status)
                            </td>
                            <td class="center">
                                @Ajax.ActionLink("Edit", "edit", new { id = item.RoleID }, AdminAjaxOptions.GetForm, new { @class = "btn-edit", title = "Edit" })
                                @Ajax.ActionLink("Delete", "delete", new { id = item.RoleID }, AdminAjaxOptions.DeleteRecord, new { @class = "btn-delete", title = "Delete" })
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        }
    </div>
</div>
